const printPyramid = (height, ...options) => {   
  // 打印金字塔的符号，如果未传入有默认值   
  const { symbol = '*', space = ' ' } = Object.assign({}, ...options)   
  for (let i = 1; i <= height; i++) {   
    const spaces = space.repeat(height - i)   
    const blocks = symbol.repeat(2 * i - 1)   
    document.write(`${spaces}${blocks}${spaces}<br/>`)   
  }   
}   
    
const height = 5 // 金字塔的高度   
printPyramid(height, { symbol: '@', space: '-' })  